<?php
@mysql_connect('localhost','root','');
@mysql_select_db('tdcms');
$pubwhat = @mysql_real_escape_string($_POST['pubwhat']);
if($pubwhat == 'table'){
	$table_q = @mysql_query("SHOW TABLES");
	if(@mysql_num_rows($table_q) > 0){
		echo 'new Array(';
		while($row = @mysql_fetch_array($table_q)){
			$tabels .= '\''.$row[0].'\',';
		}
		$tabels = substr($tabels,0,-1);
		echo $tabels.')';
	}else{
		echo 'alert(\'We are sorry we having problem to publish the data\');';
	}
}else if($pubwhat == 'columns'){
	$Table = @mysql_real_escape_string($_POST['Table']);
	$COLUMNS_q = @mysql_query("SHOW COLUMNS FROM $Table");
	if(@mysql_num_rows($COLUMNS_q) > 0){
		echo 'new Array(';
		while($row = @mysql_fetch_array($COLUMNS_q)){
			$COLUMNS .= '\''.$row[0].'\',';
		}
		$COLUMNS = substr($COLUMNS,0,-1);
		echo $COLUMNS.')';
	}else{
		echo 'alert(\'We are sorry we having problem to publish the data\');';
	}
}
?>